package com.example.demo.cat;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.listener.KafkaMessageListenerContainer;
import org.springframework.stereotype.Service;
import pumpIn.client.Client;

import java.util.Map;
import java.util.Properties;

@Service
public class KafkaClient extends Client {

    private String Id,topic,groupId;

    private KafkaMessageListenerContainer<String,String> listenerContainer;

    @Autowired
    private KafkaConsumerFactory factory;

    @Override
    public Client initClient(Properties config) {
        return null;
    }

    @Override
    public Client initClient(String topic) {
        this.listenerContainer = factory.createListenerContainer(this.groupId,topic);
        return this;
    }

    @Override
    public boolean close() {
        return false;
    }

    @Override
    public boolean start() {
        return false;
    }

    @Override
    public Map<String, Object> getMetricInfo() {
        return null;
    }
}
